package com.wan.data.mysql.orm.convert.auto;

import com.wan.data.mysql.orm.convert.AutoConverter;
import com.wan.data.mysql.orm.meta.ColumnMeta;
import com.wan.data.mysql.util.DbColumnType;

import java.math.BigDecimal;

public class DecimalConverter implements AutoConverter {
    @Override
    public Class<?>[] convertType() {
        return new Class[]{BigDecimal.class};
    }

    @Override
    public DbColumnType getDbType() {
        return DbColumnType.DECIMAL;
    }

    @Override
    public Object dbToEntity(ColumnMeta columnMeta, Object value) throws Exception {
        return value;
    }

    @Override
    public Object entityToDb(ColumnMeta columnMeta, Object value) throws Exception {
        return value;
    }
}
